<?php

session_start();
if (!isset($_SESSION['user']) || isset($_SESSION['admin'])) {
    header('location:show_mobile.php?mbname=' . $_GET['mbname'] . '&mustlogin=1');
} else {
    session_register("cart");
    $id = $_GET['item'];
    if (isset($_SESSION['cart'][$id])) {
        $qty = $_SESSION['cart'][$id] + 1;
    } else {
        $qty = 1;
    }
    $_SESSION['cart'][$id] = $qty;
    header("location:cart.php");
}
?>